home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ray Dream Studio
/
Ray Dream Studio (CDRAYD1) (Ray Dream) (1995).iso
/
DREAMSDK.WIN
/
INCLUDE
/
EVXDBAPI.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-04
|
19KB
|
402 lines
// Copyright ©1993 Ray Dream, Inc. All Right Reserved.
/* $Id: EVXDBAPI.H 1.13 1995/11/04 17:22:50 YannPC Exp $ */
// Defines the API with Ray Dream Designer 3.0's 3D Database
// Version number of the API:
//
// 0 RDD version 3.0.0
// 1 RDD version 3.0.2
// TPatchMesh primitive
// TFlatSurface primitive
// EVXTreeGlobalMatSetAll()
// EVXTreeGlobalMatGetAll()
// 2 RDD version 3.0.4
// 3 RDD version 3.1.3 (cross-platform API)
// EVXGetIndString()
#ifndef __EVXDBAPI__
#define __EVXDBAPI__
#ifndef __XRTYPES__
#include "XRTypes.h"
#endif
#ifndef __MTYPES__
#include "mtypes.h"
#endif
#ifndef __cplusplus
#ifndef class
#define class typedef void*
#endif
#endif
#ifndef IDTYPE
#define IDTYPE(x,y,z,t) ((((long)x)<<24)|(((long)y)<<16)|(((long)z)<<8)|((long)t))
#endif
#ifndef _WIN31
#define __loadds
#endif
class Riostream;
class TScene;
class TInstanciableBase;
class TImportedPrimitive;
class TPolygonMesh;
class TPatchMesh;
class TFlatSurface;
class TExtrusion;
class TCrossSection;
class TInstance;
class TComponentUI;
class TLight;
class TCamera;
class TGroup;
class TTree;
class TEVOffscreen;
class TShadingShape;
class TShader;
class TMap;
class QuickFix;
class QuickFixVector3;
struct TREETRANSFORM3D;
struct UVSpaceInfo;
struct FACET3D;
struct VERTEX3D;
struct PATCH3D;
//-- Contants for EVXTreeGetType() API 1
#define kEVXTreeGroup 1
#define kEVXTreeInstance 2
#define kEVXTreeCamera 4
#define kEVXTreeLight 8
#define kEVXTreeWorkingBox 16
//-- Parameter blocks for building extrusions:
typedef struct {
VECTOR3 fVertex; // Vertex
// Fill these only if using envelopes:
VECTOR3 fTopEnv; // Envelope: top curve on right wall
VECTOR3 fBotEnv; // Envelope: bottom curve on right wall
VECTOR3 fLeftEnv; // Envelope: left curve on floor
VECTOR3 fRightEnv; // Envelope: right curve on floor
} SEVX3DPathPoint;
typedef struct {
SEVX3DPathPoint f3DPathPrevControl1; // Don't fill this if 1st section
SEVX3DPathPoint f3DPathPrevControl2; // Don't fill this if 1st section
VECTOR3 f3DPathVertex; // Put 0 in x and z unless you know what you're doing
BOOLEAN fFill;
BOOLEAN fSkinToNext;
} SEVXExtrusionHeaderPB;
typedef struct { // Adding a non-automatic cross-section
SEVXExtrusionHeaderPB fHeader;
//-- Specific parameters:
TCrossSection* fCrossSection;
FIXED fTwisting; // Twisting angle
} SEVXExtrusionPB;
typedef struct { // Adding an automatic cross-section
SEVXExtrusionHeaderPB fHeader;
//-- Specific parameters:
FIXED fTopScaling;
FIXED fBotScaling;
FIXED fLeftScaling;
FIXED fRightScaling;
} SEVXExtrusionAutoPB;
//-- Structure for manipulating Bezier patches:
// A patch is a 4x4 array of 3D points. To access point [i,j], we follow
// the standard convention: point[i,j] = array[i*4+j] ; 0<=i,j<=3
typedef VECTOR3 SEVXPatchData[16];
#if defined(qPointersD0) && defined(__MWERKS__) && defined(qPowerPC)
#pragma pointers_in_D0
#endif
#ifdef __cplusplus
extern "C" {
#endif
//---- Misc. Utils ----
short __loadds EVXGetAppVersion(); // Returns the Application version number in BCD
long __loadds EVXGetAPINumber(); // Returns the host's API number. API 1
void __loadds EVXGetIndString(char* str, short strID, short itemNo); // API 2
//---- Riostream ----
Riostream* __loadds EVXEVStreamNew(char* fulPathName, BOOLEAN readOrWrite);
void __loadds EVXEVStreamDelete(Riostream* This);
long __loadds EVXStreamGetFileSize(Riostream* This);
//--- Progression Bar ----
void __loadds EVXProgressStart(char* prompt, long max); // prompt can be nil. new interface API 2
void __loadds EVXProgressIncrement(long increment);
void __loadds EVXProgressNewValue(long newValue); // Use either EVXProgressIncrement() or EVXProgressNewValue()
void __loadds EVXProgressDone();
//---- TComponentUI ----
TComponentUI* __loadds EVXCompUINew(long familySignature,long classSignature); // API 1
void __loadds EVXCompUIDelete(TComponentUI* This); // API 1
void __loadds EVXCompUISetParameter(TComponentUI* This, long keyword, void* parameter);
void __loadds EVXCompUIGetParameter(TComponentUI* This, long keyword, void* parameter);
//--------------------------------------------------------------------------
// Hierarchy:
// TInstanciableBase
// TImportedPrimitive
// TPolygonMesh
// TPatchMesh
// TFlatSurface
// TExtrusion
// TScene
//
// As TImportedPrimitive, TExtrusion, etc. inherit from TInstanciableBase,
// all EVXInstanciableBase… procs can be used with them. Just cast them to TInstanciableBase*.
//--------------------------------------------------------------------------
//---- TInstanciableBase ----
TInstanciableBase* __loadds EVXInstanciableBaseNew(long keyword, TScene* scene);
void __loadds EVXInstanciableBaseSetName(TInstanciableBase* This, char* name);
void __loadds EVXInstanciableBaseGetName(TInstanciableBase* This, char* name);
void __loadds EVXInstanciableBaseDelete(TInstanciableBase* This);
void __loadds EVXInstanciableSetSimpleShading(TInstanciableBase* This,
VECTOR3* color, FIXED specularityIntensity, FIXED specularityIndex,
FIXED reflection, FIXED transparency);
void __loadds EVXInstanciableSetPrimer(TInstanciableBase* This,TShader* theShader) ;
long __loadds EVXInstanciableGetUVSpace(TInstanciableBase* This,long uvSpaceID,UVSpaceInfo* theuvSpaceInfo);
long __loadds EVXInstanciableGetUVSpaceCount(TInstanciableBase* This);
void __loadds EVXInstanciableAddShadingShape(TInstanciableBase* This,TShadingShape*theShadingShape,long uvSpaceID);
BOOLEAN __loadds EVXInstanciableIsPatchBased(TInstanciableBase* This); // API 1
typedef void (*EVXInstanciableForEachFacetCallBack)(FACET3D *aF,void *priv);
void __loadds EVXInstanciableForEachFacet(TInstanciableBase* This,EVXInstanciableForEachFacetCallBack proc,void *priv); // API 1
typedef void (*EVXInstanciableForEachPatchCallBack)(PATCH3D *aF,void *priv);
void __loadds EVXInstanciableForEachPatch(TInstanciableBase* This,EVXInstanciableForEachPatchCallBack proc,void *priv); // API 1
//---- TImportedPrimitive ----
TImportedPrimitive* __loadds EVXImportedNew(TScene* scene, BOOLEAN hasNormals, BOOLEAN hasUV);
short __loadds EVXImportedAddFacet(TImportedPrimitive* This, FACET3D* facet);
long __loadds EVXImportedGetNbFacets(TImportedPrimitive* This);
FACET3D* __loadds EVXImportedGetIndFacets(TImportedPrimitive* This, long index); // (index is 1 based)
void __loadds EVXImportedRemoveFacet(TImportedPrimitive* This, long index); // (index is 1 based)
short __loadds EVXImportedPreAllocateFacets(TImportedPrimitive* This, long nbFacets);
void __loadds EVXImportedSetUVSpace(TImportedPrimitive* This, VECTOR2* minUV, VECTOR2* maxUV); // Necessary if hasUV = true
void __loadds EVXImportedCalcNormals(TImportedPrimitive* This, FIXED smoothAngle); // smoothAngle in degrees
//---- TPolygonMesh ----
TPolygonMesh* __loadds EVXPolygonMeshNew(TScene* scene, long uCount, long vCount, BOOLEAN uClosed, BOOLEAN vClosed);
void __loadds EVXPolygonMeshSetVertex(TPolygonMesh* This, long uIndex, long vIndex, VECTOR3* vertex, VECTOR3* normal); // normal can be nil
void __loadds EVXPolygonMeshGetVertex(TPolygonMesh* This, long uIndex, long vIndex, VECTOR3* vertex, VECTOR3* normal); // normal can be nil
void __loadds EVXPolygonMeshSetU(TPolygonMesh* This, long uIndex, FIXED uValue);
void __loadds EVXPolygonMeshSetV(TPolygonMesh* This, long vIndex, FIXED vValue);
void __loadds EVXPolygonMeshGetU(TPolygonMesh* This, long uIndex, FIXED* uValue);
void __loadds EVXPolygonMeshGetV(TPolygonMesh* This, long vIndex, FIXED* vValue);
void __loadds EVXPolygonMeshCalcUV(TPolygonMesh* This); // Calculate for you all (u,v) values
void __loadds EVXPolygonMeshCalcNormals(TPolygonMesh* This, BOOLEAN smooth); // Calculate for you all normals
//---- TPatchMesh ---- API 1
TPatchMesh* __loadds EVXPatchMeshNew(TScene* scene, long uCount, long vCount);
void __loadds EVXPatchMeshSetPatch(TPatchMesh* This, long uIndex, long vIndex, SEVXPatchData* vertices);
void __loadds EVXPatchMeshGetPatch(TPatchMesh* This, long uIndex, long vIndex, SEVXPatchData* vertices);
void __loadds EVXPatchMeshSetU(TPatchMesh* This, long uIndex, FIXED uValue);
void __loadds EVXPatchMeshSetV(TPatchMesh* This, long vIndex, FIXED vValue);
void __loadds EVXPatchMeshGetU(TPatchMesh* This, long uIndex, FIXED* uValue);
void __loadds EVXPatchMeshGetV(TPatchMesh* This, long vIndex, FIXED* vValue);
void __loadds EVXPatchMeshCalcUV(TPatchMesh* This); // Calculate for you all (u,v) values
//---- TFlatSurface ---- API 1
TFlatSurface* __loadds EVXFlatSurfaceNew(TScene* scene);
void __loadds EVXFlatSurfaceBeginFlatSurface(TFlatSurface* This);
void __loadds EVXFlatSurfaceEndFlatSurface(TFlatSurface* This);
void __loadds EVXFlatSurfaceBeginGroup(TFlatSurface* This);
void __loadds EVXFlatSurfaceEndGroup(TFlatSurface* This);
void __loadds EVXFlatSurfaceBeginCmpnd(TFlatSurface* This);
void __loadds EVXFlatSurfaceEndCmpnd(TFlatSurface* This);
void __loadds EVXFlatSurfaceBeginPath(TFlatSurface* This, VECTOR2* p0);
void __loadds EVXFlatSurfaceLineTo(TFlatSurface* This, VECTOR2* p1);
void __loadds EVXFlatSurfaceBezierTo(TFlatSurface* This, VECTOR2* p1, VECTOR2* p2, VECTOR2* p3);
void __loadds EVXFlatSurfaceEndPath(TFlatSurface* This);
//---- TExtrusion ----
TExtrusion* __loadds EVXExtrusionNew(TScene* scene);
void __loadds EVXExtrusionStartBuilding(TExtrusion* This, BOOLEAN pipeline, BOOLEAN useEnvelopes, short envelopesFlags);
void __loadds EVXExtrusionAddCrossSection(TExtrusion* This, SEVXExtrusionPB* pb);
void __loadds EVXExtrusionAddAutoCrossSection(TExtrusion* This, SEVXExtrusionAutoPB* pb);
void __loadds EVXExtrusionEndBuilding(TExtrusion* This);
void __loadds EVXExtrusionCenterData(TExtrusion* This); // To do after EVXExtrusionEndBuilding(). Center data using regular bbox
void __loadds EVXExtrusionCenterFacetData(TExtrusion* This); // To do after EVXExtrusionEndBuilding(). Center data using facets bbox. SLOW.
//---- TCrossSection ----
TCrossSection* __loadds EVXCrossSectionNew(TExtrusion* extrusion);
void __loadds EVXCrossSectionDelete(TCrossSection* This); // Use only if not inserted in an extrusion
TCrossSection* __loadds EVXCrossSectionClone(TCrossSection* This);
void __loadds EVXCrossSectionBeginSection(TCrossSection* This);
void __loadds EVXCrossSectionEndSection(TCrossSection* This);
void __loadds EVXCrossSectionBeginGroup(TCrossSection* This);
void __loadds EVXCrossSectionEndGroup(TCrossSection* This);
void __loadds EVXCrossSectionBeginCmpnd(TCrossSection* This);
void __loadds EVXCrossSectionEndCmpnd(TCrossSection* This);
void __loadds EVXCrossSectionBeginPath(TCrossSection* This, VECTOR2* p0);
void __loadds EVXCrossSectionLineTo(TCrossSection* This, VECTOR2* p1);
void __loadds EVXCrossSectionBezierTo(TCrossSection* This, VECTOR2* p1, VECTOR2* p2, VECTOR2* p3);
void __loadds EVXCrossSectionEndPath(TCrossSection* This);
void __loadds EVXCrossSectionMove(TCrossSection* This, VECTOR2* delta);
void __loadds EVXCrossSectionTransform(TCrossSection* This, VECTOR2* ti, VECTOR2* tj, VECTOR2* tt);
void __loadds EVXCrossSectionGetBBox(TCrossSection* This, VECTOR2* minPt, VECTOR2* maxPt);
//---- TScene ----
void __loadds EVXSceneDoRead(TScene* This, Riostream* stream, char* fullPathName);
void __loadds EVXSceneDoNeedDiskSpace(TScene* This, long* dataForkSize, long* rsrcForkSize);
void __loadds EVXSceneDoWrite(TScene* This, TTree* fatherTree, Riostream* stream, TEVOffscreen* preview, BOOLEAN writeALLobjects, char* fullPathName, short versionNumber);
void __loadds EVXSceneSetComment(TScene* This, char* comment); //comment is a pascal-string
void __loadds EVXSceneGetComment(TScene* This, char* comment); //comment is a pascal-string
// Objects (=TInstanciableBase) list:
TInstanciableBase* __loadds EVXSceneGetIndObject(TScene* This, long index); // (index is 1 based)
long __loadds EVXSceneGetNbObjects(TScene* This);
TInstanciableBase* __loadds EVXSceneGetNamedObject(TScene* This, char* name);
void __loadds EVXSceneInsertObject(TScene* This, TInstanciableBase* object);
void __loadds EVXSceneRemoveObject(TScene* This, TInstanciableBase* object);
void __loadds EVXSceneObjectChanged(TScene* This, TInstanciableBase* object);
TGroup* __loadds EVXSceneGetUniverse(TScene* This);
void __loadds EVXSceneSetUniverse(TScene* This, TGroup* universe); // Works only if This->GetUniverse() is nil
void __loadds EVXSceneCreateUniverseIfNone(TScene* This);
#ifdef __cplusplus
void __loadds EVXSceneCreateRenderingCameraIfNone(TScene* This, long camType = IDTYPE('c','o','n','i'), Boolean createDistantLight = false);
#else
void __loadds EVXSceneCreateRenderingCameraIfNone(TScene* This, long camType, Boolean createDistantLight);
#endif
TCamera* __loadds EVXSceneGetRenderingCamera(TScene* This);
void __loadds EVXSceneSetRenderingCamera(TScene* This, TCamera* camera);
// Scene Tree parsing
TLight* __loadds EVXSceneGetIndLight(TScene* This, long index); // (index is 1 based)
long __loadds EVXSceneGetNbLights(TScene* This);
TCamera* __loadds EVXSceneGetIndCamera(TScene* This, long index); // (index is 1 based)
long __loadds EVXSceneGetNbCameras(TScene* This);
TInstance* __loadds EVXSceneGetIndInstance(TScene* This, long index); // (index is 1 based)
long __loadds EVXSceneGetNbInstances(TScene* This);
// Render settings
void __loadds EVXSceneSetAmbientLight(TScene* This, COLOR* color);
void __loadds EVXSceneSetProdFormat(TScene* This, FIXED sizeh, FIXED sizev, FIXED dpi);
void __loadds EVXSceneGetAmbientLight(TScene* This, COLOR* color);
void __loadds EVXSceneGetProdFormat(TScene* This, FIXED* sizeh, FIXED* sizev, FIXED* dpi);
//--------------------------------------------------------------------------
// Hierarchy:
// TTree
// TGroup
// TLight
// TCamera
// TInstance
//
// As TGroup, TLight, TCamera and TInstance inherit from TTree,
// all EVXTree… procs can be used with them. Just cast them to TTree*.
//--------------------------------------------------------------------------
//---- TTree ----
void __loadds EVXTreeDelete(TTree* This);
short __loadds EVXTreeGetType(TTree* This); // See constants kEVXTreeGroup, kEVXTreeInstance, etc. API 1
void __loadds EVXTreeInsertFirst(TTree* This, TTree* newSon);
void __loadds EVXTreeInsertLast(TTree* This, TTree* newSon);
void __loadds EVXTreeInsertLeft(TTree* This, TTree* newBrother);
void __loadds EVXTreeInsertRight(TTree* This, TTree* newBrother);
TTree* __loadds EVXTreeGetFirst(TTree* This);
TTree* __loadds EVXTreeGetLast(TTree* This);
TTree* __loadds EVXTreeGetLeft(TTree* This);
TTree* __loadds EVXTreeGetRight(TTree* This);
TTree* __loadds EVXTreeGetTop(TTree* This);
TTree* __loadds EVXTreeUnLink(TTree* This); // Return old father
long __loadds EVXTreeGetNumber(TTree* This);
void __loadds EVXTreeSetNumber(TTree* This, long number);
void __loadds EVXTreeSetName(TTree* This, char* name);
void __loadds EVXTreeGetName(TTree* This, char* name);
void __loadds EVXTreeSetRDD2Mat(TTree* This, FIXED* matRDD2); // Ray Dream, Inc. use only
void __loadds EVXTreeMatReset(TTree* This);
void __loadds EVXTreeMatTranslate(TTree* This, VECTOR3* translation);
void __loadds EVXTreeMatSetAll(TTree* This, TREETRANSFORM3D* treeTransform);
void __loadds EVXTreeMatGetAll(const TTree* This, TREETRANSFORM3D* treeTransform);
void __loadds EVXTreeGlobalMatSetAll(TTree* This, TREETRANSFORM3D* treeTransform);
void __loadds EVXTreeGlobalMatGetAll(const TTree* This, TREETRANSFORM3D* treeTransform);
void __loadds EVXTreeCenterObjectOnHotPoint(TTree* This);
void __loadds EVXTreeCenterHotPointOnObject(TTree* This);
void __loadds EVXTreeTranslateHotPoint(TTree* This, VECTOR3* deltahp);
void __loadds EVXTreeGetHotPoint(const TTree* This, QuickFixVector3* hp);
void __loadds EVXTreeSetHotPoint(TTree* This, const QuickFixVector3* hp);
TTree* __loadds EVXTreeClone(TTree* This, BOOLEAN cloneAll);
TTree* __loadds EVXTreeCopy(TTree* This, BOOLEAN cloneAll);
#ifdef __cplusplus
void __loadds EVXTreeGetBBox(TTree* This, BOX3D* box, BOOLEAN noLightsCameras = false);
#else
void __loadds EVXTreeGetBBox(TTree* This, BOX3D* box, BOOLEAN noLightsCameras);
#endif
void __loadds EVXTreeBeginMove(TTree* This);
void __loadds EVXTreeEndMove(TTree* This);
//---- TGroup ----
TGroup* __loadds EVXGroupNew(TScene* scene);
void __loadds EVXGroupSetBBox(TGroup* This, BOX3D* box);
void __loadds EVXGroupSetOpenClose(TGroup* This, BOOLEAN openIt);
BOOLEAN __loadds EVXGroupIsOpen(TGroup* This);
void __loadds EVXGroupDoOpenClose(TGroup* This, BOOLEAN openIt);
//---- TLight ----
TLight* __loadds EVXLightNew(long keyword, TScene* scene);
void __loadds EVXLightSetParameter(TLight* This, long keyword, void* parameter);
void __loadds EVXLightGetParameter(TLight* This, long keyword, void* parameter);
//---- TCamera ----
#ifdef __cplusplus
enum EEVXPosition {kReference,kTop,kBottom,kLeft,kRight,kFront,kBack};
#else
enum {kReference,kTop,kBottom,kLeft,kRight,kFront,kBack};
typedef short EEVXPosition;
#endif
TCamera* __loadds EVXCameraNew(long keyword, TScene* scene);
void __loadds EVXCameraPreset(TCamera* This, EEVXPosition position, VECTOR3* aimedPoint, FIXED distance);
void __loadds EVXCameraSetParameter(TCamera* This, long keyword, void* parameter);
void __loadds EVXCameraGetParameter(TCamera* This, long keyword, void* parameter);
//---- TInstance ----
TInstance* __loadds EVXInstanceNew(TScene* scene);
void __loadds EVXInstanceSetInstanciable(TInstance* This, TInstanciableBase* object);
TInstanciableBase* __loadds EVXInstanceGetInstanciable(TInstance* This);
void __loadds EVXInstanceGetColor(TInstance* This, COLOR* color);
long __loadds EVXInstanceGetUVSpace(TInstance* This,long uvSpaceID,UVSpaceInfo* theuvSpaceInfo);
long __loadds EVXInstanceGetUVSpaceCount(TInstance* This);
void __loadds EVXInstanceAddShadingShape(TInstance* This,TShadingShape*theShadingShape,long uvSpaceID);
//---- TShadingShape ----
TShadingShape* __loadds EVXShadingShapeNew(long itsClass);
void __loadds EVXShadingShapeSetShader(TShadingShape* This,TShader* theShader);
void __loadds EVXShadingShapeSetBBox(TShadingShape* This,BOX2D* box);
//---- TShader ----
TShader* __loadds EVXShaderNew(long itsClass);
void __loadds EVXShaderSetParameter(TShader* This, long keyword, void* parameter);
void __loadds EVXShaderGetParameter(TShader* This, long keyword, void* parameter);
//---- TMap ----
TMap* __loadds EVXMapNew();
#ifdef __cplusplus
}
#endif
#if defined(qPointersD0) && defined(__MWERKS__) && defined(qPowerPC)
#pragma pointers_in_A0
#endif
void InitializeEVXDB();
void TerminateEVXDB();
#endif